import { lazy } from "react"; //路由懒加载
import Home from "../views/Home"; //引入默认页面
import {
    WapHomeO,
    AppsO,
    RefundO,
    FriendsO,
    ShoppingCartO
} from '@react-vant/icons'; //引入图标

const routes = [
    {
    path: "/home",
    component: Home,
    children: [{
            path: "/home/index",
            component: lazy(() => import("../views/home/Index")),
            title: "首页",
            icon: < WapHomeO />
        },
        {
            path: "/home/classify",
            component: lazy(() => import("../views/home/Classify")),
            title: "分类",
            icon: < AppsO />
        },
        {
            path: "/home/jingxi",
            component: lazy(() => import("../views/home/Jingxi")),
            title: "京喜",
            icon: < RefundO />
        },
        {
            path: "/home/cart",
            component: lazy(() => import("../views/home/Cart")),
            title: "购物车",
            icon: <ShoppingCartO  />
        },
        {
            path: "/home/my",
            component: lazy(() => import("../views/home/My")),
            title: "我的",
            icon: <FriendsO  />
        },

    ]
    },
    {
        path:"/search",
        component: lazy(() => import("../views/Search")),
        title:"搜索"
    },
    // 重定向 
    {
        path:"/",
        redirect: '/home/index',  // 重定向:重新指向其它path,会改变网址
    }
]

// 抛出 
export default routes